﻿using System;
using System.ComponentModel;

namespace Entity
{
    public class customer_repair_for_return_search : customer_repair
    {
        /// <summary>
        /// 
        /// </summary>
        public int return_count { get; set; }
    }


    public class customer_repair
    {
        /// <summary>
        /// 报修ID 
        /// </summary>
        public string repair_id { get; set; }
        /// <summary>
        /// 所属用户
        /// </summary>
        public string user_id { get; set; }
        /// <summary>
        /// 所属用户名称
        /// </summary>
        public string user_name { get; set; }

        /// <summary>
        ///  客户微信名称
        /// </summary>
        public string user_wx_name { get; set; }
        /// <summary>
        ///  客户账号
        /// </summary>
        public string user_loginname { get; set; }
        /// <summary>
        /// 客户手机号
        /// </summary>
        public string user_tel { get; set; }
        /// <summary>
        /// 机器ID
        /// </summary>
        public string mch_id { get; set; }
        /// <summary>
        ///  机器SN 
        /// </summary>
        public string mch_sn { get; set; }
        /// <summary>
        /// 机器名称
        /// </summary>
        public string mch_name { get; set; }
        /// <summary>
        /// 机器类型
        /// </summary>
        public string mch_type { get; set; }
        /// <summary>
        /// 机器质保开始时间
        /// </summary>
        public DateTime? mch_assurance_sdt { get; set; }
        /// <summary>
        /// 报修类型
        /// </summary>
        public string repair_type { get; set; }
        /// <summary>
        /// 报修子类型
        /// </summary>
        public string repair_kid_type { get; set; }
        /// <summary>
        /// 如果在报修类型里没有 则可以手写类型
        /// </summary>
        public string repair_other { get; set; }
        /// <summary>
        /// 问题描述
        /// </summary>
        public string repair_des { get; set; }
        /// <summary>
        /// 问题描述图片
        /// </summary>
        public string repair_des_pic { get; set; }
        /// <summary>
        /// 报修时间
        /// </summary>
        public DateTime? repair_time { get; set; }
        /// <summary>
        ///  处理状态
        /// </summary>
        public repair_handle_state repair_handle_state { get; set; }
        /// <summary>
        ///  售后处理结果
        /// </summary>
        public string customer_repair_handle_result { get; set; }
        /// <summary>
        /// 技术售后处理结果
        /// </summary>
        public string technology_repair_handle_result { get; set; }
        /// <summary>
        /// 审核处理结果
        /// </summary>
        public string approval_repair_handle_result { get; set; }
        /// <summary>
        /// 处理时间
        /// </summary>
        public DateTime? repair_handle_endtime { get; set; }
        /// <summary>
        /// 提交审批时间
        /// </summary>
        public DateTime? repair_approval_addtime { get; set; }
        /// <summary>
        /// 审批内容
        /// </summary>
        public string repair_approval_des { get; set; }
        /// <summary>
        /// 报修内容物照片
        /// </summary>
        public string repair_content_pic { get; set; }
        /// <summary>
        /// 快递单号
        /// </summary>
        public string repair_express_no { get; set; }
        /// <summary>
        /// 审批时间
        /// </summary>
        public DateTime? repair_approval_time { get; set; }
        /// <summary>
        /// 售后ID
        /// </summary>
        public string customer_uid { get; set; }
        public string customer_uname { get; set; }
        /// <summary>
        /// 技术售后ID
        /// </summary>
        public string technology_uid { get; set; }
        public string technology_uname { get; set; }
        /// <summary>
        /// 审批ID
        /// </summary>
        public string approval_uid { get; set; }
        public string approval_name { get; set; }
        /// <summary>
        /// 提交时间
        /// </summary>
        public DateTime addtime { get; set; }
        /// <summary>
        /// 报修人电话
        /// </summary>
        public string repair_tel { get; set; }
        /// <summary>
        /// 审批模式
        /// </summary>
        public approval_model? approval_model { get; set; }
        /// <summary>
        /// 快递模式
        /// </summary>
        public string express_model { get; set; }
        /// <summary>
        /// 运费
        /// </summary>
        public decimal? freight { get; set; }
        /// <summary>
        /// 审批金额
        /// </summary>
        public decimal? approval_price { get; set; }
        /// <summary>
        ///  坏件返回状态
        /// </summary>
        public return_approval_state reback_state { get; set; } = return_approval_state.无需返件;
        /// <summary>
        ///  返回日期
        /// </summary>
        public DateTime? reback_time { get; set; }
        /// <summary>
        /// 返回结果
        /// </summary>
        public string reback_result { get; set; }
        /// <summary>
        /// 确认人
        /// </summary>
        public string reback_confirm_uid { get; set; }
        #region   返件审批后新增 
        /// <summary>
        ///  寄件审批-快递单号
        /// </summary>
        public string express_no { get; set; }
        /// <summary>
        /// 寄件状态
        /// </summary>
        public express_state? express_state { get; set; } = Entity.express_state.无寄件;
        #endregion
        #region 超保转账截图
        /// <summary>
        /// 超保转账截图
        /// </summary>

        public string transfer_screenshot { get; set; }

        /// <summary>
        ///  寄件时间(修改)
        /// </summary>
        public DateTime? express_time { get; set; }
        #endregion
    }


    public class customer_repair_for_statistics : customer_repair
    {
        /// <summary>
        /// 返件ID
        /// </summary>
        public string repair_return_id { get; set; }
        /// <summary>
        /// 返件类型
        /// </summary>
        public return_type? return_type { get; set; }
        /// <summary>
        /// 返件单号
        /// </summary>
        public string return_express_no { get; set; }
        /// <summary>
        /// 返件描述
        /// </summary>
        public string return_des { get; set; }
        /// <summary>
        /// 返件审批状态
        /// </summary>
        public return_approval_state? return_approval_state { get; set; }
        /// <summary>
        /// 返件审批说明
        /// </summary>
        public string return_approval_des { get; set; }
        /// <summary>
        /// 返件数量
        /// </summary>
        public int? return_sort { get; set; }
        /// <summary>
        /// 返件图片
        /// </summary>
        public string return_pic { get; set; }
        /// <summary>
        /// 提交人
        /// </summary>
        public string submit_uname { get; set; }
        /// <summary>
        /// 返件审批人
        /// </summary>
        public string return_approval_name { get; set; }
        /// <summary>
        /// 返件时间
        /// </summary>
        public DateTime? approval_time { get; set; }
    }
    public enum express_state
    {
        无寄件 = 0,
        已寄出 = 1,
        未寄出 = 2
    }
    public enum approval_model
    {
        在保审批 = 0,
        超保审批 = 1
    }
    public enum repair_handle_state
    {
        //小于3的时候不允许完成
        售后处理中 = 0,
        技术售后处理中 = 1,
        审批处理中 = 2,
        审批完成 = 3,
        审批被驳回 = 4,
        审批关闭 = 5,
        已完成 = 6,
        已关闭 = 10,
    }


    /// <summary>
    /// 指定谁能看见这条数据
    /// </summary>
    public class customer_repair_canshow
    {
        /// <summary>
        ///  
        /// </summary>
        public string canshow_id { get; set; }
        /// <summary>
        /// 员工ID
        /// </summary>
        public string uid { get; set; }
        /// <summary>
        /// 报修ID
        /// </summary>
        public string repair_id { get; set; }
    }
    /// <summary>
    /// 提交一条报修登记信息
    /// </summary>
    public class repair_register_params
    {
        /// <summary>
        /// 机器ID
        /// </summary>
        public string mchid { get; set; }
        /// <summary>
        /// 报修类型
        /// </summary>
        public string repair_type { get; set; }
        /// <summary>
        /// 报修类型子类型
        /// </summary>
        public string repair_kid_type { get; set; }
        /// <summary>
        /// 如果报修类型里不存在则自定义
        /// </summary>
        public string repair_other { get; set; }
        /// <summary>
        /// 报修描述
        /// </summary>
        public string repair_des { get; set; }
        /// <summary>
        /// 报修人电话
        /// </summary>
        public string repair_tel { get; set; }
        /// <summary>
        /// 问题描述图片
        /// </summary>
        public string[] repair_des_pic { get; set; }
    }

    public class save_repair_params
    {
        public string repair_id { get; set; }

        public string repair_type { get; set; }
        public string repair_kid_type { get; set; }

        public string repair_des { get; set; }
        /// <summary>
        /// 问题描述图片
        /// </summary>
        public string[] repair_des_pic { get; set; }

        public int? change_state { get; set; }

        public string technology_repair_handle_result { get; set; }

        public string customer_repair_handle_result { get; set; }

        public string repair_des_pic_str
        {
            get; set;
        }
    }


    public class customer_repairForexcelPage
    {
        [Description("报修日期")]
        public string repair_time { get; set; }

        [Description("客户姓名")]
        public string user_name { get; set; }

        [Description("机器类型")]
        public string mch_type { get; set; }

        [Description("机器SN")]
        public string mch_sn { get; set; }
        [Description("机器名称")]
        public string mch_name { get; set; }

        [Description("质保开始时间")]
        public string mch_assurance_sdt { get; set; }

        [Description("报修类型")]
        public string repair_type { get; set; }
        [Description("报修小类")]
        public string repair_kid_type { get; set; }
        [Description("问题描述")]
        public string repair_des { get; set; }
        [Description("售后专员")]
        public string customer_uname { get; set; }
        [Description("售后处理结果")]
        public string customer_repair_handle_result { get; set; }
        [Description("技术售后")]
        public string technology_uname { get; set; }
        [Description("技术售后处理结果")]
        public string technology_repair_handle_result { get; set; }
        [Description("disable")]
        public repair_handle_state repair_handle_state { get; set; }
        [Description("处理状态")]
        public string repair_handle_state_str { get { return this.repair_handle_state.ToString(); } }
        [Description("处理时间")]
        public DateTime? repair_handle_endtime { get; set; }
        [Description("审批人")]
        public string approval_name { get; set; }
        [Description("disable")]
        public string approval_state_str { get { return ((apply_state)((int)this.repair_handle_state)).ToString(); } }
        [Description("审批时间")]
        public DateTime? repair_approval_time { get; set; }
        [Description("审批内容")]
        public string repair_approval_des { get; set; }
        [Description("寄件单号")]
        public string express_no { get; set; }
        [Description("disable")]
        public string repair_express_no { get; set; }
        [Description("disable")]
        public string have_express_no { get { return string.IsNullOrWhiteSpace(this.repair_express_no) ? "否" : "是"; } }

        [Description("disable")]
        public return_approval_state reback_state { get; set; }

        [Description("disable")]
        public string reback_state_str
        {
            get
            {
                return reback_state.ToString();
                //return !this.reback_state.HasValue ? "" : this.reback_state == 1 ? "已完成" : "未完成";
            }
        }
        [Description("disable")]
        public DateTime? reback_time { get; set; }

        [Description("disable")]
        public string reback_result { get; set; }

        [Description("disable")]
        /// <summary>
        /// 返件ID
        /// </summary>
        public string repair_return_id { get; set; }
        [Description("disable")]
        /// <summary>
        /// 返件类型
        /// </summary>
        public return_type? return_type { get; set; }
        [Description("返件类型")]
        public string return_type_str
        {
            get
            {
                return !return_type.HasValue ? "无需返件" : return_type.Value.ToString();
            }
        }
        [Description("返件单号")]
        /// <summary>
        /// 返件单号
        /// </summary>
        public string return_express_no { get; set; }
        [Description("返件说明")]
        /// <summary>
        /// 返件描述
        /// </summary>
        public string return_des { get; set; }
        [Description("disable")]
        /// <summary>
        /// 返件审批状态
        /// </summary>
        public return_approval_state? return_approval_state { get; set; }
        [Description("返件审批状态")]
        public string return_approval_state_str
        {
            get
            {
                return !return_approval_state.HasValue ? "无需返件" : return_approval_state.Value.ToString();
            }
        }
        [Description("返件审批说明")]
        /// <summary>
        /// 返件审批说明
        /// </summary>
        public string return_approval_des { get; set; }
        [Description("提交次数")]
        /// <summary>
        /// 提交次数
        /// </summary>
        public int? return_sort { get; set; }
        [Description("disable")]
        /// <summary>
        /// 返件图片
        /// </summary>
        public string return_pic { get; set; }
        [Description("返件审核提交人")]
        /// <summary>
        /// 提交人
        /// </summary>
        public string submit_uname { get; set; }
        [Description("返件审核审批人")]
        /// <summary>
        /// 返件审批人
        /// </summary>
        public string return_approval_name { get; set; }
        [Description("返件审批时间")]
        /// <summary>
        /// 返件时间
        /// </summary>
        public DateTime? approval_time { get; set; }
        [Description("disable")]
        /// <summary>
        /// 报修ID
        /// </summary>
        public string repair_id { get; set; }
    }
    public class customer_repair_showpic_ForexcelPage
    {
        [Description("提交日期")]
        public string screenshot_subtime { get; set; }
        [Description("提交人")]
        public string customer_uname { get; set; }
        [Description("客户姓名")]
        public string user_name { get; set; }
        [Description("质保开始时间")]
        public string mch_assurance_sdt { get; set; }
        [Description("机器SN")]
        public string mch_sn { get; set; }
        [Description("机器名称")]
        public string mch_name { get; set; }
        [Description("机器类型")]
        public string mch_type { get; set; }
        [Description("微信截图")]
        public string wxrecord_screenshot { get; set; }
        [Description("理货后微信截图")]
        public string tallyafter_screenshot { get; set; }
    }
    public class reback_data_info_params
    {
        public string repair_id { get; set; }
        /// <summary>
        /// 返回配件状态 0未完成 1已完成
        /// </summary>
        public int? reback_state { get; set; }
        /// <summary>
        ///  返回配件结果
        /// </summary>
        public string reback_result { get; set; }
    }


    /// <summary>
    /// 审核参数
    /// </summary>
    public class application_approval_Params
    {
        /// <summary>
        /// 报修ID
        /// </summary>
        public string repair_id { get; set; }
        /// <summary>
        /// 提交审核人ID
        /// </summary>
        public string approval_uid { get; set; }
        /// <summary>
        ///  报修审核详情
        /// </summary>
        public string repair_approval_des { get; set; }
        /// <summary>
        /// 报修模式
        /// </summary>
        public approval_model? approval_model { get; set; }
        /// <summary>
        /// 报修model
        /// </summary>
        public string express_model { get; set; }
        /// <summary>
        /// 运费
        /// </summary>
        public decimal? freight { get; set; }
        /// <summary>
        /// 审核金额
        /// </summary>
        public decimal? approval_price { get; set; }
        /// <summary>
        /// 快递单号
        /// </summary>
        public string express_no { get; set; }
        /// <summary>
        /// 转账截图
        /// </summary>
        public string[] transfer_screenshot { get; set; }
    }
    /// <summary>
    /// 用于导出超保审批excel的定义
    /// </summary>
    public class get_my_approval_pagelist_excel
    {
        [Description("disable")]
        public string repair_id { get; set; }
        [Description("报修日期")]
        public DateTime addtime { get; set; }
        [Description("提交人")]
        /// <summary>
        /// 提交人
        /// </summary>
        public string technology_uname { get; set; }
        [Description("提交日期")]
        /// <summary>
        /// 提交日期
        /// </summary>
        public DateTime? repair_approval_addtime { get; set; }
        [Description("客户姓名")]
        /// <summary>
        /// 客户姓名
        /// </summary>
        public string user_name { get; set; }
        [Description("质保开始时间")]
        /// <summary>
        /// 质保开始时间
        /// </summary>
        public DateTime? mch_assurance_sdt { get; set; }
        [Description("审批人")]
        /// <summary>
        /// 审批人
        /// </summary>
        public string approval_name { get; set; }
        [Description("审批状态")]
        /// <summary>
        /// 处理状态
        /// </summary>
        public string repair_handle_state_str { get; set; }
        [Description("审批时间")]
        /// <summary>
        /// 审批时间
        /// </summary>
        public DateTime? repair_approval_time { get; set; }
        [Description("审批金额")]
        /// <summary>
        /// 审批金额
        /// </summary>
        public decimal? approval_price { get; set; }
        [Description("快递模式")]
        /// <summary>
        /// 快递模式
        /// </summary>
        public string express_model { get; set; }
        [Description("运费")]
        /// <summary>
        /// 运费
        /// </summary>
        public decimal? freight { get; set; }
        [Description("寄件单号")]
        /// <summary>
        /// 寄件单号
        /// </summary>
        public string express_no { get; set; }
        [Description("寄件状态")]
        /// <summary>
        /// 寄件状态描述
        /// </summary>
        public string express_state_str { get; set; }
        [Description("disable")]
        /// <summary>
        /// 快递单号
        /// </summary>
        public string repair_express_no { get; set; }
        [Description("disable")]
        /// <summary>
        /// 报修图片描述
        /// </summary>
        public string repair_content_pic { get; set; }
        [Description("disable")]
        /// <summary>
        /// 报修状态
        /// </summary>
        public repair_handle_state repair_handle_state { get; set; }
        [Description("disable")]
        /// <summary>
        /// 是否有图片
        /// </summary>
        public bool hava_pic { get; set; }

        [Description("disable")]
        /// <summary>
        /// 返件状态
        /// </summary>
        public return_approval_state? reback_state { get; set; }
        [Description("disable")]
        /// <summary>
        /// 返件时间
        /// </summary>
        public DateTime? reback_time { get; set; }
        [Description("disable")]
        /// <summary>
        /// 返件结果
        /// </summary>
        public string reback_result { get; set; }
        [Description("disable")]
        /// <summary>
        /// 返件审核人
        /// </summary>
        public string reback_confirm_uid { get; set; }
        [Description("disable")]
        /// <summary>
        /// 寄件状态
        /// </summary>
        public express_state? express_state { get; set; }
        [Description("disable")]
        /// <summary>
        /// 寄件时间
        /// </summary>
        public DateTime? express_time { get; set; }
        [Description("disable")]
        /// <summary>
        /// 返件状态描述
        /// </summary>
        public string reback_state_str { get; set; }
        [Description("disable")]
        /// <summary>
        /// 超保转账截图
        /// </summary>
        public string transfer_screenshot { get; set; }
        [Description("disable")]
        /// <summary>
        /// 审批模式
        /// </summary>
        public approval_model? approval_model { get; set; }
        [Description("disable")]
        /// <summary>
        /// 报修审批描述
        /// </summary>
        public string repair_approval_des { get; set; }
        [Description("disable")]
        /// <summary>
        /// 报修图片描述
        /// </summary>
        public string repair_des_pic { get; set; }
    } 
    public class get_approval_pagelist_for_Excel
    {

        [Description("disable")]
        /// <summary>
        /// 报修ID
        /// </summary>
        public string repair_id { get; set; }
        [Description("报修日期")]
        /// <summary>
        /// 添加时间
        /// </summary>
        public DateTime addtime { get; set; }
        [Description("提交人")]
        /// <summary>
        /// 提交人
        /// </summary>
        public string technology_uname { get; set; }
        [Description("提交日期")]
        /// <summary>
        /// 提交日期
        /// </summary>
        public DateTime? repair_approval_addtime { get; set; }
        [Description("客户姓名")]
        /// <summary>
        /// 用户名称
        /// </summary>
        public string user_name { get; set; }
        [Description("质保开始时间")]
        /// <summary>
        /// 质保开始时间
        /// </summary>
        public DateTime? mch_assurance_sdt { get; set; }
        [Description("审批人")]
        /// <summary>
        /// 审批人
        /// </summary>
        public string approval_name { get; set; }

        [Description("审批状态")]
        public string approval_model_str
        {
            get { return approval_model.HasValue ? "" : approval_model.ToString(); }
        }
        [Description("审批状态")]
        /// <summary>
        ///  审核时间
        /// </summary>
        public DateTime? repair_approval_time { get; set; }
        [Description("快递模式")]
        /// <summary>
        /// 快递模式
        /// </summary>
        public string express_model { get; set; }

        [Description("寄件单号")]
        /// <summary>
        /// 寄件单号
        /// </summary>
        public string express_no { get; set; }
        [Description("寄件状态")]
        /// <summary>
        /// 寄件状态文字描述
        /// </summary>
        public string express_state_str { get; set; }
        [Description("寄件时间")]
        /// <summary>
        /// 寄件时间
        /// </summary>
        public DateTime? express_time { get; set; }
        [Description("寄件时间")]
        /// <summary>
        /// 寄件超期情况
        /// </summary>
        public string return_out_des { get; set; }

        [Description("disable")]
        /// <summary>
        /// 审核模式
        /// </summary>
        public approval_model? approval_model { get; set; }
        [Description("disable")]
        /// <summary>
        /// 报修状态说明
        /// </summary>
        public string repair_handle_state_str { get; set; }
        [Description("disable")]
        /// <summary>
        /// 快递单号
        /// </summary>
        public string repair_express_no { get; set; }

        [Description("disable")]
        /// <summary>
        /// 报修图片
        /// </summary>
        public string repair_content_pic { get; set; }
        [Description("disable")]
        /// <summary>
        /// 是否存在图片
        /// </summary>
        public bool hava_pic { get; set; }
        [Description("disable")]
        /// <summary>
        /// 审核描述
        /// </summary>
        public string repair_approval_des { get; set; }
        [Description("disable")]
        /// <summary>
        /// 审核图片
        /// </summary>
        public string repair_des_pic { get; set; }
        [Description("disable")]
        /// <summary>
        /// 报修状态
        /// </summary>
        public repair_handle_state? repair_handle_state { get; set; }
        [Description("disable")]
        /// <summary>
        /// 审核金额
        /// </summary>
        public decimal? approval_price { get; set; }
        [Description("disable")]
        /// <summary>
        /// 运费
        /// </summary>
        public decimal? freight { get; set; }
        [Description("disable")]
        /// <summary>
        ///  返回审核状态
        /// </summary>
        public return_approval_state? reback_state { get; set; }
        [Description("disable")]
        /// <summary>
        ///  返件时间
        /// </summary>
        public DateTime? reback_time { get; set; }
        [Description("disable")]
        /// <summary>
        /// 返件结果
        /// </summary>
        public string reback_result { get; set; }
        [Description("disable")]
        /// <summary>
        /// 返件审核人
        /// </summary>
        public string reback_confirm_uid { get; set; }
        [Description("disable")]
        /// <summary>
        /// 审核结果
        /// </summary>
        public string approval_repair_handle_result { get; set; }
        [Description("disable")]
        /// <summary>
        /// 提交返件时间
        /// </summary>
        public int? return_count { get; set; }
        [Description("disable")]
        /// <summary>
        /// 寄件状态
        /// </summary>
        public express_state? express_state { get; set; }
    }
}
